#ifndef N0OBJECT_H
#define N0OBJECT_H 

#include "N0Types.h"

class N0Object {
    N0UInt32 m_counter;
public:
    N0Object() { m_counter = 1; }
    virtual ~N0Object() { };

    N0UInt32   getCounter() { return m_counter; };
    N0UInt32   retain() { return ++m_counter; };
    N0UInt32   release() 
    {
        N0UInt32 cnt = --m_counter;
        if (cnt==0)
        {
            delete this;
        }
        return cnt;
    };
};

#endif //N0OBJECT_H
